<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
查询日期范围：<input id="beginTime" type="text" name="beginTime">到
<input id="endTime" type="text" name="endTime">
<button onclick="serchInfo()">查询</button>
<table>
    <tr>
        <th>交易时间</th>
        <th>收入</th>
        <th>支出</th>
        <th>交易类型</th>
        <th>余额</th>
        <th>备注</th>
    </tr>
    <tbody id="tid"></tbody>
</table>
<script type="text/javascript" src="js/jquery-1.8.3.min.js"></script>
<script>
    $(function(){
        serchInfo()
    })
    function serchInfo() {
        $.ajax({
            type:"get",
            url:"trade/list.do",
            data:{beginTime:$("#beginTime").val(),endTime:$("#endTime").val()},
            dataType:"json",
            success:function (data) {
                console.log(data)
                if (data.code==1){
                    $("#tid").empty();
                    var  infos=data.info
                    $(infos).each(function (){
                        var html ='<tr>\n'+
                            '<td>'+this.createTime+ '</td>\n'+
                            '<td>'+this.income+ '</td>\n'+
                            '<td>'+this.pay+ '</td>\n'+
                            '<td>'+this.balance+ '</td>\n'+
                            '<td>'+this.consumType+ '</td>\n'+
                            '<td>'+this.comment+ '</td>\n'+
                            '</tr>'
                        $("#tid").append($(html))
                    })
                }
            }
        })
    }
</script>
</body>
</html>